package com.example.common;

import org.assertj.core.util.Arrays;

import java.util.stream.Stream;

public class EnvUtils {

    public static final String LOCAL = "local";
    public static final String DEV = "dev";

    public static boolean isLocal(String[] activeProfiles) {

        if (Arrays.isNullOrEmpty(activeProfiles)) {
            return false;
        }

        if (Stream.of(activeProfiles).anyMatch(t -> t.equalsIgnoreCase(DEV)) ||
                Stream.of(activeProfiles).anyMatch(t -> t.equalsIgnoreCase(LOCAL))) {
            return true;
        }


        return false;

    }
}
